home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Otherware
/
Otherware_1_SB_Development.iso
/
mac
/
hypercar
/
xcmd
/
newfolde.sit
/
NF Source
/
HyperXCmd.h
next >
Wrap
Text File
|
1989-05-16
|
4KB
|
125 lines
/*
HyperXCmd.h Definitions for calling all standard
HyperCard callback routines from C.
⌐Apple Computer, Inc. 1987
All Rights Reserved.
See CFlash.C for an example of how to include this module in your
C program.
*/
typedef struct XCmdBlock {
short paramCount;
Handle params[16];
Handle returnValue;
Boolean passFlag;
char * entryPoint; /* to call back to HyperCard */
short request;
short result;
long inArgs[8];
long outArgs[4];
} XCmdBlock, *XCmdBlockPtr;
typedef struct Str31 {
char guts[32];
} Str31, *Str31Ptr;
/*result codes */
#define xresSucc 0
#define xresFail 1
#define xresNotImp 2
/* request codes */
#define xreqSendCardMessage 1
#define xreqEvalExpr 2
#define xreqStringLength 3
#define xreqStringMatch 4
#define xreqSendHCMessage 5
#define xreqZeroBytes 6
#define xreqPasToZero 7
#define xreqZeroToPas 8
#define xreqStrToLong 9
#define xreqStrToNum 10
#define xreqStrToBool 11
#define xreqStrToExt 12
#define xreqLongToStr 13
#define xreqNumToStr 14
#define xreqNumToHex 15
#define xreqBoolToStr 16
#define xreqExtToStr 17
#define xreqGetGlobal 18
#define xreqSetGlobal 19
#define xreqGetFieldByName 20
#define xreqGetFieldByNum 21
#define xreqGetFieldByID 22
#define xreqSetFieldByName 23
#define xreqSetFieldByNum 24
#define xreqSetFieldByID 25
#define xreqStringEqual 26
#define xreqReturnToPas 27
#define xreqScanToReturn 28
#define xreqScanToZero 39 /* was suppose to be 29! Oops! */
/* Forward definitions of glue routines. Main program
must include XCmdGlue.inc.c. See XCmdGlue.inc.c for
documentation of each routine. */
typedef void (*MyProcPtr) ();
extern pascal void SendCardMessage(XCmdBlockPtr paramPtr,StringPtr msg);
extern pascal Handle EvalExpr(XCmdBlockPtr paramPtr,StringPtr expr);
extern pascal long StringLength(XCmdBlockPtr paramPtr,StringPtr strPtr);
extern pascal Ptr StringMatch(XCmdBlockPtr paramPtr,StringPtr pattern,
Ptr target);
extern pascal void ZeroBytes(XCmdBlockPtr paramPtr,Ptr dstPtr,
long longCount);
extern pascal Handle PasToZero(XCmdBlockPtr paramPtr,StringPtr pasStr);
extern pascal void ZeroToPas(XCmdBlockPtr paramPtr,char *zeroStr,
StringPtr pasStr);
extern pascal long StrToLong(XCmdBlockPtr paramPtr,Str31 *strPtr);
extern pascal long StrToNum(XCmdBlockPtr paramPtr,Str31 *str);
extern pascal Boolean StrToBool(XCmdBlockPtr paramPtr,Str31 *str);
#ifdef extended
extern pascal void StrToExt(XCmdBlockPtr paramPtr,Str31 *str,
extended *myext);
#endif
extern pascal void LongToStr(XCmdBlockPtr paramPtr,long posNum,
Str31 *mystr);
extern pascal void NumToStr(XCmdBlockPtr paramPtr,long num,Str31 *mystr);
extern pascal void NumToHex(XCmdBlockPtr paramPtr,long num,short nDigits,
Str31 *mystr);
extern pascal void BoolToStr(XCmdBlockPtr paramPtr,Boolean bool,
Str31 *mystr);
#ifdef extended
extern pascal void ExtToStr(XCmdBlockPtr paramPtr,extended *myext,
Str31 *mystr);
#endif
extern pascal Handle GetGlobal(XCmdBlockPtr paramPtr,StringPtr globName);
extern pascal void SetGlobal(XCmdBlockPtr paramPtr,StringPtr globName,
Handle globValue);
extern pascal Handle GetFieldByName(XCmdBlockPtr paramPtr,
Boolean cardFieldFlag,StringPtr fieldName);
extern pascal Handle GetFieldByNum(XCmdBlockPtr paramPtr,
Boolean cardFieldFlag,short fieldNum);
extern pascal Handle GetFieldByID(XCmdBlockPtr paramPtr,
Boolean cardFieldFlag,short fieldID);
extern pascal void SetFieldByName(XCmdBlockPtr paramPtr,
Boolean cardFieldFlag,StringPtr fieldName,Handle fieldVal);
extern pascal void SetFieldByNum(XCmdBlockPtr paramPtr,
Boolean cardFieldFlag,short fieldNum,Handle fieldVal);
extern pascal void SetFieldByID(XCmdBlockPtr paramPtr,Boolean cardFieldFlag,
short fieldID,Handle fieldVal);
extern pascal Boolean StringEqual(XCmdBlockPtr paramPtr,Str31 *str1,
Str31 *str2);
extern pascal void ReturnToPas(XCmdBlockPtr paramPtr,Ptr zeroStr,
StringPtr pasStr);
extern pascal void ScanToReturn(XCmdBlockPtr paramPtr,Ptr *scanHndl);
extern pascal void ScanToZero(XCmdBlockPtr paramPtr,Ptr *scanHndl);